﻿@model AlmKickstart.Data.Project
@{
    ViewBag.Title = "Edit";
	
	if(Model.ParentProjectId.HasValue)
	{
		ViewBag.Previous = Model.ParentProject.ProjectType.Name + " #" + Model.ParentProjectId + ">> ";
	}
}

<h2>@ViewBag.Previous @Model.ProjectType.Name #@Model.ProjectId</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <div class="ContentSection">
		<h3>Item Details</h3>
        <div class="EditorElement">
            @Html.LabelFor(model => model.Name)
            @Html.EditorFor(model => model.Name)
        </div>
        <div class="EditorElement">
            @Html.LabelFor(model => model.StartDate)
            @Html.EditorFor(model => model.StartDate)
        </div>
        <div class="EditorElement">
            @Html.LabelFor(model => model.DueDate)
            @Html.EditorFor(model => model.DueDate)
        </div>
        <div class="EditorElement">
            @Html.LabelFor(model => model.StatusId, "Status")
            @Html.DropDownList("StatusId", String.Empty)
        </div>
		<div class="EditorElement">
            @Html.LabelFor(model => model.Description)
            @Html.EditorFor(model => model.Description)
        </div>
        <p>
            <input type="submit" value="Save" class="k-button" />
        </p>
    </div>
}

@Html.Action("List", new { id = Model.ProjectId })


<p>
@if (Model.ParentProjectId.HasValue)
{
	@Html.ActionLink("<- Back to Parent " + Model.ParentProject.ProjectType.Name, "Edit", new { id = Model.ParentProjectId }, new { @class = "k-button" })
}
else
{
	@Html.ActionLink("<- Back to " + Model.ProjectType.PluralName, "Index", new { projectType = Model.ProjectType.ProjectTypeId }, new { @class = "k-button" })
}
</p>